#pragma once
#include <WinSock2.h>
#include "Configuration.h"

#define OVERLAPPED_TYPE_ACCEPT	1
#define OVERLAPPED_TYPE_RECV	2
#define OVERLAPPED_TYPE_SEND	4

class TCPClient;
class TCPServer;
class UDPClient;
struct OverlappedData
{
	OVERLAPPED Overlapped;
	SOCKET Socket;
	WSABUF Buffer;
	DWORD BytesTransferred;
	DWORD Flags;
	sockaddr_in Address;
	int AddressLen;
	char Data[BUFFER_SIZE];
	int Type;
	TCPServer* Server;
	TCPClient* Client;
	UDPClient* Peer;
};

OverlappedData* OverlappedData_Alloc(int type);

void OverlappedData_Free(OverlappedData** data);
